MAE(x, ...)
"MAE"(x, ref, na.rm = FALSE, ...)
"MAE"(x, ...)
MAPE(x, ...)
"MAPE"(x, ref, na.rm = FALSE, ...)
"MAPE"(x, ...)
SMAPE(x, ...)
"SMAPE"(x, ref, na.rm = FALSE, ...)
"SMAPE"(x, ...)
MSE(x, ...)
"MSE"(x, ref, na.rm = FALSE, ...)
"MSE"(x, ...)
RMSE(x, ...)
"RMSE"(x, ref, na.rm = FALSE, ...)
"RMSE"(x, ...)
NMAE(x, ref, train.y)
NMSE(x, ref, train.y)
NA
values first (if requested).
MAE calculates the mean absolute error:
$$\frac{1}{n} \cdot \sum_{i=1}^{n}\left | ref_{i}-x_{i} \right |$$MAPE calculates the mean absolute percentage error: $$\frac{1}{n} \cdot \sum_{i=1}^{n}\left | \frac{ref_{i}-x_{i}}{ref_{i}} \right |$$
SMAPE calculates the symmetric mean absolute percentage error: $$\frac{1}{n} \cdot \sum_{i=1}^{n}\frac{2 \cdot \left | ref_{i}-x_{i} \right |}{\left | ref_{i} \right | + \left | x_{i} \right |}$$
MSE calculates mean squared error: $$\frac{1}{n} \cdot \sum_{i=1}^{n}\left ( ref_{i}-x_{i} \right )^2$$
RMSE calculates the root mean squared error: $$\sqrt{\frac{1}{n} \cdot \sum_{i=1}^{n}\left ( ref_{i}-x_{i} \right )^2}$$
Torgo, L. (2010) Data Mining with R: Learning with Case Studies, Chapman and Hall/CRC Press
lm
, resid
r.lm <- lm(Fertility ~ ., data=swiss)
MAE(r.lm)
# the same as:
MAE(predict(r.lm), swiss$Fertility)
MAPE(r.lm)
MSE(r.lm)
RMSE(r.lm)
Run the code above in your browser using DataLab